package service

import (
	"html/template"
	"net/http"

	"github.com/unrolled/render"
)

func loginHandler(formatter *render.Render) http.HandlerFunc {

	return func(w http.ResponseWriter, r *http.Request) {
		r.ParseForm()
		username := template.HTMLEscapeString(r.Form.Get("username"))
		password := template.HTMLEscapeString(r.Form.Get("password"))

		formatter.HTML(w, http.StatusOK, "detail", struct {
			Username string `json:"username"`
			Password string `json:"password"`
		}{Username: username, Password: password})
	}
}
